package com.scf.loan.controller;

import com.scf.loan.Service.LawService;
import com.scf.loan.entity.Borrowings;
import com.scf.loan.entity.PageBean;
import com.scf.uitl.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/law")

public class LawController {
	@Resource
private LawService lawService;
	// 查询所有需要法务审核合同
	@PostMapping("/alllaw")
	public ResponseResult allAsset(@RequestBody PageBean pageBean) {
		ResponseResult responseResult = new ResponseResult();
		List<Borrowings> borrowings = lawService.alllaw(pageBean);

		pageBean.setBeanList(borrowings);
		pageBean.setTotalRecord(lawService.counts(pageBean));
		responseResult.setCode(200);
		responseResult.setData(pageBean);
		System.out.println(responseResult);

		return responseResult;
	}


}
